﻿using System.IO;

namespace GeckoLib {
    public class DummyStream : Stream {
        public readonly byte DummyData;
        public DummyStream(byte dummyData = (byte)0xFF) {
            DummyData = dummyData;
        }
        public override void Flush() { }

        public override long Seek(long offset, SeekOrigin origin) { return -1; }

        public override void SetLength(long value) { }

        public override int Read(byte[] buffer, int offset, int count) {
            for (var i = 0; i < count; i++) buffer[i + offset] = DummyData;
            return count;
        }

        public override void Write(byte[] buffer, int offset, int count) { }

        public override bool CanRead {
            get { return true; }
        }

        public override bool CanSeek {
            get { return true; }
        }

        public override bool CanWrite {
            get { return true; }
        }

        public override long Length {
            get { return -1; }
        }

        public override long Position {
            get { return -1; }
            set { }
        }
    }
}
